/*
 * isLooped.cpp
 *
 *  Created on: Aug 20, 2012
 *      Author: xkq
 */

#include <iostream>
#include "LinkedListNode.h"
using namespace std;

bool isLooped(Node *head){
	if(!head) return false;
	Node *fast = head, *slow = head;

	while(fast != NULL){
		fast=fast->next->next;
		slow=slow->next;
		if(fast==slow)
			return true;
	}
	return false;
}


